﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using AssemblyProvider.Web;
using AssemblyProvider.Web.Entities;
using System.Diagnostics;

namespace UnitTests
{
    [TestClass]
    public class AbstraXProviderTests
    {
        [TestMethod]
        public void TestAssemblyProvider()
        {
            try
            {
                var service = new AssemblyProviderService();
                var root = service.GetAssembliesRoot();

                foreach (var assembly in service.GetAssembliesForAssembliesRoot(root.ID))
                {
                    Debug.WriteLine(assembly.Name);

                    foreach (var type in service.GetTypesForAssembly(assembly.ID))
                    {
                        Debug.WriteLine(type.Name);

                        foreach (var propertyElement in service.GetPropertyElementsForType(type.ID))
                        {
                            Debug.WriteLine(propertyElement.Name);
                        }

                        foreach (var propertyAttribute in service.GetPropertyAttributesForType(type.ID))
                        {
                            Debug.WriteLine(propertyAttribute.Name);
                        }

                        foreach (var operation in service.GetOperationsForType(type.ID))
                        {
                            Debug.WriteLine(operation.Name);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Debugger.Break();
            }
        }
    }
}
